package com.kingsoft.dc.khaos.extender.meta.impl;

import com.alibaba.fastjson.JSON;
import com.kingsoft.dc.khaos.extender.meta.model.ds.Connect;
import com.kingsoft.dc.khaos.extender.meta.model.ds.KyligenceConnect;
import com.kingsoft.dc.khaos.extender.meta.model.ds.MysqlConnect;
import com.kingsoft.dc.khaos.extender.meta.utils.RSAEncrypt;

/**
 * Created by jing on 19/6/25.
 */
public class kyligenceDmMetaImpl extends DmMetaImpl {

    @Override
    public Connect decryptDatasourceConnectSecret(String config) {
        KyligenceConnect connect = JSON.parseObject(config, KyligenceConnect.class);
        try {
            connect.setPassWord(RSAEncrypt.decryptByRSAPassWord(connect.getPassWord()));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return connect;
    }


}
